//
//  Level.m
//  genePool_8.2
//
//  Created by Greg Dunn on 11/9/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "SSLevel.h"

@implementation SSLevel

@synthesize background, overlay, worldFriction, worldGravity, playerInitialLocation, enemies, items, hasIntro, hasOutro, introBG, introMovie, introCountdown, outroBG, outroMovie;
@synthesize emitter, bgMusic;

- (id) init
{
	if ((self = [super init]))
	{ 
		bgMusic = @"background.caf";
	}
	return (self);
} // init

-(Boolean)completedGoal
{
    if(true)
	{
		return true;
	} else {
		return false;
	}
}

-(CGSize)getLevelSize{
   // CCTMXLayer *mapLayer = (CCTMXLayer *)[backgroundTileMap getChildByTag:0];
//	return CGSizeMake((mapLayer.layerSize.width * mapLayer.mapTileSize.width), (mapLayer.layerSize.height * mapLayer.mapTileSize.height));
	return CGSizeMake(320, 480);
}

#pragma mark Background Prarticle/Wetter

-(void)initEmitterRainWithTotalParticles:(NSUInteger)totalParticles{
	self.emitter = [CCParticleRain node];
	//[background addChild: emitter z:10];
	
	//CGPoint p = emitter.position;
	emitter.position = ccp(110, 0);
	emitter.life = 4;
	if (totalParticles == -1) {
		totalParticles = 2000;
	}
	emitter.totalParticles = totalParticles;
	
	emitter.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.pvr"];
	
	//emitter.position = ccp(self.position.x + 52, self.position.y + 28);
}

-(void)initEmitterSnowWithTotalParticles:(NSUInteger)totalParticles{
	self.emitter = [CCParticleSnow node];
	//[background addChild: emitter z:10];
	
//	CGPoint p = emitter.position;
	emitter.position = ccp(110, 0);
	emitter.life = 3;
	emitter.lifeVar = 1;
	emitter.startSize = 5.0f;
	emitter.startSizeVar = 5.0f;
	if (totalParticles == -1) {
		totalParticles = 200;
	}
	
	emitter.totalParticles = totalParticles;
	// gravity
	emitter.gravity = ccp(0,-10);
	
	// speed of particles
	emitter.speed = 50;
	emitter.speedVar = 30;
	
	
	ccColor4F startColor = emitter.startColor;
	startColor.r = 0.9f;
	startColor.g = 0.9f;
	startColor.b = 0.9f;
	emitter.startColor = startColor;
	
	ccColor4F startColorVar = emitter.startColorVar;
	startColorVar.b = 0.1f;
	emitter.startColorVar = startColorVar;
	
	emitter.emissionRate = emitter.totalParticles/emitter.life;
	
	emitter.texture = [[CCTextureCache sharedTextureCache] addImage: @"snow.png"];
}



@end
